//****************************************************************************
// lineTracker.c -
//****************************************************************************

#include "inc/hw_types.h"
#include "drivers/motor.h"

#include "drive.h"
#include "distanceIR.h"
#include "helper.h"
#include "wireless.h"


void FollowLeader()
{
	DanceInstruction nextInstruction;
	unsigned long distanceValue = ReadIRDistanceValue();

	displayMessageAndNumber("Distance", (int) distanceValue);

	if(distanceValue < 600)
	{
		if(WasInstructionReceived(&nextInstruction))
			DriveInstruction(nextInstruction);
	}
	else
		DriveStop();

}

